﻿using VCode.Models;

namespace VCode
{
    internal class Program
    {/// <summary>
    /// 维吉尼亚密码
    /// </summary>
    /// <param name="args"></param>
        static void Main(string[] args)
        {
            ///加密
            //用户输入明文和密匙
            Console.WriteLine("请输入明文：");
            string plain1=Console.ReadLine();
            Console.WriteLine("请输入密匙：");
            string key1=Console.ReadLine();
            ///加密过程
            MyEncoder myEncoder =new MyEncoder();
            myEncoder.PlainText=plain1;
            myEncoder.Key=key1;
            myEncoder.Encode();
           ///输出加密后的密文
            Console.WriteLine("密文为：");
            Console.WriteLine(myEncoder.Cypher );
            Console.WriteLine();
            ///解密
            //用户输入密文和密匙
            Console.WriteLine("请输入密文:");
            string Cypher2=Console.ReadLine();
            Console.WriteLine("请输入密匙");
            string key2=Console.ReadLine();
            //解密过程
            MyEncoder2 myEncoder1=new MyEncoder2();
            myEncoder1.Cypher=Cypher2;
            myEncoder1.Key=key2;
            myEncoder1.Encode2();
            //输出解密后的明文
            Console.WriteLine("明文为：");
            Console.WriteLine(myEncoder1.PlainText);

        }
    }
}